@echo off
setlocal enabledelayedexpansion

set /p winRARPath="please input your winRAR path:(such as C:\Program Files\WinRAR\WinRAR.exe):"

rem 遍历当前目录下的.7z、.zip、.rar文件
for %%f in (*.7z *.zip *.rar) do (
    set "fileName=%%~nf"
    set "extension=%%~xf"
    rem 创建以文件名命名的文件夹
    md "!fileName!"
    rem 使用 WinRAR 解压文件到新创建的文件夹
    "!winRARPath!" x "%%f" "!fileName!"
)
echo all success!
pause